<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>
    <script type="text/javascript" src="/Public/Admin/js/libs/modernizr.min.js"></script>
    <script src="/Public/Admin/js/libs/jquery.js"></script>
    <script src="/Public/Admin/js/libs/list.js"></script>
    <script src="/Public/Admin/js/libs/allDel.js"></script>
</head>
<body>
<?php echo W("Public/topShow");?>
<div class="container clearfix">
    <?php echo W("Public/sideShow");?>
    <!--/sidebar-->
    <div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="<?php echo U('Index/index');?>">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">文章管理</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="/admin.php/Article/index" method="get">
                    <table class="search-tab">
                        <tr>
                            <th width="70">文章名称:</th>
                            <td><input class="common-text" placeholder="文章名(可模糊查询)" name="title" value="<?php echo ($title); ?>" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
            <form action="/admin.php/Article/delArticle" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="<?php echo U('Article/addArticle');?>"><i class="icon-font"></i>新增文章</a>
                        <a id="batchDel" href="/admin.php/Article/delArticle"><input type="submit" class="delete"><i class="icon-font"></i>批量删除</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
                            <th>ID</th>
                            <th>文章名称</th>
                            <th>所属类别</th>
			    <th>是否推荐</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        <?php if(is_array($articles)): foreach($articles as $key=>$articles): ?><tr  class="userChoose">
                            <td class="tc"><input name="id[]" value="<?php echo ($articles["id"]); ?>" type="checkbox"></td>
                            <td><?php echo ($articles["id"]); ?></td>
                            <td><?php echo ($articles["title"]); ?></td>
                            <td><?php echo ($articles["pid"]); ?></td>
                            <td><?php if($articles[flag] != ''): ?>已推荐<?php else: ?>不推荐<?php endif; ?></td>
                            <td><?php echo (date("Y-m-d",$articles["time"])); ?></td>
                            <td>
                                <a class="link-update" href="/admin.php/Article/modArticle?id=<?php echo ($articles["id"]); ?>">修改</a>
                                <a class="link-del" href="/admin.php/Article/delArticle?id=<?php echo ($articles["id"]); ?>">删除</a>
                            </td>
                        </tr><?php endforeach; endif; ?>
                    </table>
                    <div class="list-page"><?php echo ($page); ?></div>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->
</div>
</body>
</html>